
import java.util.Scanner;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author TQNINH
 */
public class Test {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner input = new Scanner(System.in);
        
        int a;
        System.out.print("Dec: ");
        a = input.nextInt();
        System.out.println("-> Bin: " + Integer.toBinaryString(a));
        System.out.println("-> Hex: " + Integer.toHexString(a));
        System.out.println("End!");
        
        //Convert from HexaDecimal to Decimal
        String b;
        System.out.print("Hex: ");
        input.nextLine();
        b = input.nextLine();
        System.out.println("-> Dec: " + Integer.parseInt(b, 16));
        System.out.println("End!");
        
        //Convert from Binary to Decimal
        String c;
        System.out.print("Binary: ");
        c = input.nextLine();
        System.out.println("-> Dec: " + Integer.parseInt(c, 2));
        System.out.println("End!");
    }
}
